create a custom method laravel model

116

<?php
namespace App\Traits;

trait EmailConfirmation
{
    /**
     * Set email_verified_at to now and save.
     *
     */
    public function confirmEmailNow()
    {
        $this->email_verified_at = now();
        $this->save();
        return $this;
    }
}

Comments

Submit
0 Comments